package com.imdroid.udp.push.objects;

import com.imdroid.udp.FileTypes;

public class UTeamDestination extends Pushable {
	
	/**
	 * Team Destination
	 */
	private String destination;
	
	/**
	 * The longitude of the destination
	 */
	private float lon;
	
	/**
	 * The latitude of the destination
	 */
	private float lat;
	
	/**
	 * if need to search route when setting the destination
	 */
	private boolean searchRoute;
	
	public UTeamDestination(String destination, float teamDestinationLat,
			float teamDestinationLon, boolean searchRoute) {
		this.destination = destination;
		this.lat = teamDestinationLat;
		this.lon = teamDestinationLon;
		this.searchRoute = searchRoute;
	}
	
	@Override
	protected byte getHeader() {
		return FileTypes.TEAM_DESTINATION;
	}

	@Override
	protected String getBody() {
		return ((destination != null) ? destination.trim():"") 
				+ "&&" + lat + "&&" + lon + "&&" + (searchRoute ? "1" : 0);
	}

}
